import { useState, useEffect } from 'react';
import { getChannelList } from '@/apis/publish';

const useChannels = () => {
  const [channelList, setChannelList] = useState([]);

  useEffect(
    () => {
      const fetchChannels = async () => {
        const { channels } = await getChannelList();
        setChannelList(channels);
      }
      fetchChannels();
    },
    []
  );

  return { channelList };
};


export default useChannels;